package com.boruan.qq.zxgylibrary.constants;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.multidex.MultiDex;

import com.convenient.qd.core.base.callback.IAppLife;
import com.convenient.qd.core.user.UserDBHelper;

/**
 * Created by 崔琦 on 2019/8/20.
 * des: ....
 */

public class MyApplication implements IAppLife {

    /** SharedPreference保存一些简单的数据到本地 */
    public static SharedPreferences mSharedPreferences;
    private static Context appContext;

    @Override
    public void attachBaseContext(Context base) {

    }

    @Override
    public void onCreate(Application application) {

        init(application);


    }

    @Override
    public void onTerminate(Application application) {

    }


    public static void init(Application application){
        //refWatcher= setupLeakCanary();
        appContext = application.getApplicationContext();
        mSharedPreferences = appContext.getSharedPreferences("baseInfo",  Context.MODE_PRIVATE);
        MultiDex.install(appContext);

    }


    /** 外部得到SharedPreference的接口 */
    public static SharedPreferences getSharedreferences() {
        return mSharedPreferences;
    }
}
